package threading;
//进程等待
public class demo5 {
    public static void main(String[] args) {
        Thread t = new Thread(()->{
            for (int i = 0; i < 5; i++) {
                System.out.println("hello thread!");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.getStackTrace();
                }
            }
        });
        t.start();

        System.out.println("main线程join之前");
        try {
            t.join();
        } catch (InterruptedException e) {
            e.getStackTrace();
        }
        System.out.println("main线程join之后");
    }
}
